import { lazy } from "react";
import Home from '../path/home/Index'
import Login from '../path/login/Index'
import Error from '../path/404/Index'
import { createBrowserRouter, Navigate } from "react-router-dom";
let Order=lazy(()=>import('../path/404/Index'))
let User=lazy(()=>import('../path/404/Index'))
export const menu_router=[
    {
        path:'/home/order',
        element:<Order></Order>
    },
    {
        path:'/home/user',
        element:<User></User>
    }
]
const routes=createBrowserRouter([
    {
        path:"/",
        element:<Navigate to={'/home'}></Navigate>
    },
    {
        path:'/home',
        element:<Home></Home>,
        children:menu_router
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'/404',
        element:<Error></Error>
    }
])
export default routes